Using Regular Expressions for Class Mapping
Configuration
{ "id": 6, "name": "mapping 6", "importType": "smartExcel", "classKey": "Class", "columnHeaderIsPropertyName": true, "data": [ { "selector": { "path": "$.items[*].properties[?(@.key==\"Class\")]", "regex": "^.*BallValve$" }, "ecClass": { "name": "BALL_VALVE", "fullName": "ProcessFunctional:BALL_VALVE" } }, { "sourceClass": "Pump", "targetClass": "CENTRIFUGAL_PUMP" } ], }
The first data entry now consists of a selector and an EC class object instead of only "sourceClass" and "targetClass" properties. In the selector, you define how to find the class property in the json source data with a json path expression. The "regex" then matches the value of that property. By using this method, you can map the ball valve and the extended ball valve to same EC class without having two data objects in the mapping.